home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
3006
/
3006.xpi
/
chrome
/
dwhelper.jar
/
content
/
download-queue.xml
< prev
next >
Wrap
Extensible Markup Language
|
2010-01-15
|
4KB
|
150 lines
<?xml version="1.0"?>
<!-- *****************************************************************************
* Copyright (c) 2006-2009 Michel Gutierrez. All Rights Reserved.
****************************************************************************** -->
<!DOCTYPE bindings SYSTEM "chrome://dwhelper/locale/dwhelper.dtd" >
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="DownloadQueue" extends="widgets.xml#widget">
<xbl:content xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox flex="1">
<tree
anonid="xTree"
id="dwhelper-download-queue"
flex="1"
enableColumnDrag="false"
hidecolumnpicker="true"
flags="dont-build-content"
datasources="rdf:null"
ref="urn:root"
>
<treecols>
<treecol
id="dwhelper-download-queue-col0"
anonid="xCol0"
xbl-persist="downloadqueue-col0:width,ordinal,hidden,sortActive,sortDirection"
primary="true"
flex="1"
label="&column.file-name;"
sort="?url"
/>
</treecols>
<template>
<rule>
<conditions>
<content uri="?root"/>
<member container="?root" child="?entry"/>
<triple subject="?entry"
predicate="http://downloadhelper.net/1.0#status"
object="queued"/>
<triple subject="?entry"
predicate="http://downloadhelper.net/1.0#label"
object="?label"/>
</conditions>
<bindings>
</bindings>
<action>
<treechildren>
<treeitem
uri="?entry" open="true">
<treerow>
<treecell
label="?label"
/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
</template>
</tree>
<hbox anonid="xButBox" hidden="true">
<button anonid="xRemoveBut" label="&button.remove-downloads;" flex="1"
oncommand="this.parentXBL.remove()"/>
</hbox>
</vbox>
<children style="display: none;"/>
</xbl:content>
<implementation>
<constructor>
<![CDATA[
this.dlMgr=Components.classes["@downloadhelper.net/download-manager;1"]
.getService(Components.interfaces.dhIDownloadMgr);
this.util.setDatasource(this.xTree,this.dlMgr.queueDatasource);
setTimeout(function(_this) { _this.doMonitorXBLPersist=true; },0,this);
]]>
</constructor>
<method name="remove">
<body>
<![CDATA[
var sel=this.getSelectedMedias();
this.dlMgr.removeFromQueue(sel,sel.length);
]]>
</body>
</method>
<method name="getSelectedMedias">
<body>
<![CDATA[
var sel=[];
try {
if(this.xTree.view==null)
return sel;
if(this.xTree.view.selection.count<1)
return sel;
if(this.xTree.builderView==null)
return sel;
var numRanges = this.xTree.view.selection.getRangeCount();
for (var t=0; t<numRanges; t++){
var start={};
var end={};
this.xTree.view.selection.getRangeAt(t,start,end);
for (var v=start.value; v<=end.value; v++) {
if(v>=0) {
var res=this.xTree.builderView.getResourceAtIndex(v);
sel.push(res);
}
}
}
return sel;
} catch(e) {
return [];
}
]]>
</body>
</method>
</implementation>
<handlers>
<handler event="select">
<![CDATA[
var entries=this.getSelectedMedias();
if(entries.length==0)
this.xButBox.setAttribute("hidden","true");
else
this.xButBox.setAttribute("hidden","false");
]]>
</handler>
</handlers>
</binding>
</bindings>